#include <REGX52.H>
#include "LCD1602.h"
#include "Delay.h"
#include "IR.h"




unsigned char Num = 23;
unsigned char Address;
unsigned char Command;


void main()
{
	LCD_Init();		//LCD初始化
	IR_Init();
	
	LCD_ShowString(1,1,"ADDR  CMD  NUM");
	LCD_ShowString(2,1," 00   00   000");	
	
	while(1)
	{
		if (IR_GetDataFlag() || IR_GetRepeatFlag())
		{
			Address = IR_GetAddress();
			Command = IR_GetCommand();
			
			LCD_ShowHexNum(2,2,Address,2);
			LCD_ShowHexNum(2,7Command,2);
			
			if (Command == IR_VOL_MINUS)
			{
				Num--;
			}
			if (Command == IR_VOL_ADD)
			{
				Num++;
			}
			LCD_ShowNum(2,12,Num,3);
		}
		
	}
}






















